-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making it easier to supply async http configuration. #274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Would we have both means of configuring or pick just one?
We could also do something like the stepfunctions API and have a fluent factory class to reduce the verbosity. public final class DynamoDbFluent {
public static AttributeValue.Builder attributeValue();
public static PutItemRequest.Builder putItemRequest();
} |
I think they're both useful in different situations. The I also like the named static methods that will create a builder for you - that was actually in my original builder proposal way back when |
* | ||
* @see #asyncHttpConfiguration(ClientAsyncHttpConfiguration) | ||
*/ | ||
default B asyncHttpConfiguration(UnaryOperator<ClientAsyncHttpConfiguration.Builder> asyncHttpConfiguration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a Consumer
to match builder's apply
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup - could be - I never liked that it mutated it, but that's the pattern we've followed before so it's probably better to remain consistent.
I've got to be honest: DynamoDBAsyncClient.builder().asyncHttpConfiguration(
b -> b.httpClientFactory(NettySdkHttpClientFactory.builder()
.maxConnectionsPerEndpoint(MAX_CONNECTIONS)))
.build(); This example is really hard to read. I can't really tell what it's doing the same way as the first. I'm worried we're going overboard with these methods. |
Also, I'm a bit confused why we don't have to call |
Definitely open to other suggestions here - this pattern makes sense to me, the IDE helps you a lot - I think there's similar patterns in languages like Kotlin/Scala so hopefully it's a pattern that's becoming more prevalent. We already use this pattern on our model object's
|
I didn't remember this specific piece of feedback. I suppose it's down to personal preference? In any case I don't think we'd take away the other methods, this just gives customers the option of omitting the |
Sorry to be that guy, but we need to talk about applying that (excluding |
8a3c974
to
ee27b94
Compare
Based on the feedback offline have removed the overload that takes a builder and calls build on behalf of the caller. |
Description
Instead of having to do this:
we can do :